#pragma once
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/beast/websocket.hpp>
#include <rapidjson/document.h>
#include <unordered_map>
#include <string>
#include <iostream>
#include <memory>
#include "https_connection_pool.h"

// 市场配置信息结构体
struct MarketInfo {
    std::string taker_fee;
    std::string maker_fee;
    std::string liquidation_fee;
    std::string min_base_amount;
    std::string min_quote_amount;
    std::string order_quote_limit;
    int supported_size_decimals;
    int supported_price_decimals;
    int supported_quote_decimals;
    int size_decimals;
    int price_decimals;
};

// Config 管理类
class Config {
public:
    std::unordered_map<int, std::string> marketIdToSymbol;
    std::unordered_map<std::string, int> symbolToMarketId;
    std::unordered_map<int, MarketInfo> marketInfoMap;
    // 初始化函数
    virtual bool init(std::shared_ptr<HttpsConnectionPool>& httpsConnPool) = 0;
};

class LighterConfig : public Config {
public:
    bool init(std::shared_ptr<HttpsConnectionPool>& httpsConnPool) override;
    
};

class BinanceConfig : public Config {
public:
    bool init(std::shared_ptr<HttpsConnectionPool>& httpsConnPool) override;
};
